package com.punai.common.core.domain.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.punai.common.core.domain.BaseEntity;
import com.punai.common.core.domain.TreeParentBo;

import java.util.ArrayList;
import java.util.Collection;


@TableName("sys_pn_dictionary")
public class SysPnDictionary extends BaseEntity implements TreeParentBo {

    @TableId
    private String id;

    private Long companyId;

    private String code;

    private String name;

    private Integer sorting;

    private String parentId;

    private String varParams;

    private String value;

    private String remarks;


    @TableField(exist = false)
    private Integer editState;
    @TableField(exist = false)
    private Integer version;
    @TableField(exist = false)
    private Collection<SysPnDictionary> children = new ArrayList<>();


    public String getId() {
        return id;
    }

    @Override
    public String getPid() {
        return getParentId();
    }

    public void setId(String id) {
        this.id = id;
    }

    public Long getCompanyId() {
        return companyId;
    }

    public void setCompanyId(Long companyId) {
        this.companyId = companyId;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getName() {
        return name;
    }

    @Override
    public Integer getOrderNum() {
        return getSorting();
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getSorting() {
        return sorting;
    }

    public void setSorting(Integer sorting) {
        this.sorting = sorting;
    }

    public String getParentId() {
        return parentId;
    }

    public void setParentId(String parentId) {
        this.parentId = parentId;
    }

    public String getVarParams() {
        return varParams;
    }

    public void setVarParams(String varParams) {
        this.varParams = varParams;
    }

    public String getValue() {
        return value;
    }

    public void setValue(String value) {
        this.value = value;
    }

    public String getRemarks() {
        return remarks;
    }

    public void setRemarks(String remarks) {
        this.remarks = remarks;
    }

    public Integer getEditState() {
        return editState;
    }

    public void setEditState(Integer editState) {
        this.editState = editState;
    }

    public Integer getVersion() {
        return version;
    }

    public void setVersion(Integer version) {
        this.version = version;
    }

    public Collection<SysPnDictionary> getChildren() {
        return children;
    }

    public void setChildren(Collection<SysPnDictionary> children) {
        this.children = children;
    }

    @Override
    public String toString() {
        return "SysPnDictionary{" +
                "id='" + id + '\'' +
                ", companyId=" + companyId +
                ", code='" + code + '\'' +
                ", name='" + name + '\'' +
                ", sorting=" + sorting +
                ", parentId='" + parentId + '\'' +
                ", varParams='" + varParams + '\'' +
                ", value='" + value + '\'' +
                ", remarks='" + remarks + '\'' +
                ", editState=" + editState +
                ", version=" + version +
                '}';
    }
}
